package hlhj.fhp.checkpoint.presenter

import android.content.Context
import com.example.mymvp.log
import com.example.mymvp.mvp.BasePresenter
import hlhj.fhp.checkpoint.iview.LoginView
import hlhj.fhp.checkpoint.javaBean.LoginBean
import hlhj.fhp.checkpoint.javaBean.MyBaseBean
import hlhj.fhp.checkpoint.javaBean.SendSMSBean
import hlhj.fhp.checkpoint.module.LoginModule

/**
 * Created by Never Fear   on 2018\11\13 0013.
Never More....
 */
class LoginPresenter :BasePresenter<LoginModule,LoginView>(), LoginModule.LoginListener {
    override fun createModule() {
        module=LoginModule()
        module.listener=this
    }
    fun login(phone:String,code:String,recommend:String,imei:String,c: Context){
        module?.login(phone, code, recommend, imei, c)
    }

    fun sendSms(phone:String,c:Context){
        module?.sendSms(phone, c)
    }
    override fun sendSmsResp(myBaseBean: SendSMSBean) {
        log("okgo","到这了么？")
        view?.sendSmsResp(myBaseBean)
    }

    override fun loginResp(loginBean: LoginBean) {
        view?.loginResp(loginBean)
    }
}